﻿<ui:DialogWindow 
    x:Class="BuildSkull.View.BuildCrashedDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0"
    Background="{DynamicResource VsBrush.Window}"
    Foreground="{DynamicResource VsBrush.WindowText}"
    Title="Build Crashed"
    Width="500" Height="355">
    
    <Grid x:Name="Root" Margin="0,10,10,0">
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="76" />
        </Grid.ColumnDefinitions>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="20" />
            <RowDefinition Height="240" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock
            Grid.Row="0"
            Margin="10,0,0,0">
            <Run Text="You crashed the build(s)! " FontWeight="Bold" />
        </TextBlock>

        <ScrollViewer
            Grid.Row="1"
            Margin="10,0,0,0"
            ScrollViewer.HorizontalScrollBarVisibility="Auto"
            ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ItemsControl
                x:Name="BuildsItemsControl"
                ItemsSource="{Binding Path=Builds, Mode=OneWay}"
                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                ScrollViewer.VerticalScrollBarVisibility="Disabled">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock TextTrimming="CharacterEllipsis">
                            <Run Text="Build:" FontWeight="Bold" />
                            <Run Text="{Binding Path=BuildDefinition.Model.Name}" />
                            <LineBreak />
                            <Run Text="Build Number:" />
                            <Run Text="{Binding Path=BuildRun.BuildNumber}" />
                            <Run Text=", Started:" />
                            <Run Text="{Binding Path=BuildRun.StartTime}" />
                            <LineBreak />
                            <Run Text="Committer:" />
                            <Run Text="{Binding Path=BuildRun.CommittedBy.Name}" />
                            <Run Text=", Revision:" />
                            <Run Text="{Binding Path=BuildRun.Revision}" />
                            <LineBreak />
                            <LineBreak />
                            </TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>

        <Canvas Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="appbar_warning" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0">
            <Path Width="43.9488" Height="40.9682" Canvas.Left="16.0256" Canvas.Top="14.4489" Stretch="Fill" Fill="OrangeRed" Data="F1 M 58.5832,55.4172L 17.4169,55.4171C 15.5619,53.5621 15.5619,50.5546 17.4168,48.6996L 35.201,15.8402C 37.056,13.9852 40.0635,13.9852 41.9185,15.8402L 58.5832,48.6997C 60.4382,50.5546 60.4382,53.5622 58.5832,55.4172 Z M 34.0417,25.7292L 36.0208,41.9584L 39.9791,41.9583L 41.9583,25.7292L 34.0417,25.7292 Z M 38,44.3333C 36.2511,44.3333 34.8333,45.7511 34.8333,47.5C 34.8333,49.2489 36.2511,50.6667 38,50.6667C 39.7489,50.6667 41.1666,49.2489 41.1666,47.5C 41.1666,45.7511 39.7489,44.3333 38,44.3333 Z "/>
        </Canvas>
        
        <Button
            Grid.Column="0" Grid.Row="2"
            Margin="10,10,0,0" Padding="5"
            Width="100"
            HorizontalAlignment="Left" Click="Button_Click">
            OK
        </Button>

    </Grid>

</ui:DialogWindow>
